<template name="Channels">
  {{#contentFor "menu"}}
    <p class="navbar-text pull-left text-ellipsis menu-title" style="width: calc(100% - 90px);">{{channel.address}}</p>
  {{/contentFor}}

  {{#Layout template="InboxLayout" hasRight=hasRight hasSidebar=hasSidebar}}
    {{> ThreadList}}

    {{> contentFor region="header" template="ThreadHeader" data=thread}}
    {{> contentFor region="right" template="Thread" data=thread}}
    {{> contentFor region="sidebar" template="ThreadDetail" data=thread}}
  {{/Layout}}
</template>

<template name="ChannelMenu">
  <ul class="dropdown-menu" role="menu">
    <li><a href="#" id="btn-channel-members"><i class="fa fa-users"></i> {{_ "channel_members"}}</a></li>
    {{#if currentUser.isAdmin}}
      <li class="divider"></li>
      <li><a href="#" id="btn-edit-channel"><i class="fa fa-edit"></i> {{_ "channel_action_edit"}}</a></li>
      <li class="divider"></li>
      <li><a href="#" id="btn-add-channel"><i class="fa fa-plus"></i> {{_ "channel_action_new"}}</a></li>
    {{/if}}
  </ul>
</template>

<template name="ChannelMenuItems">
  {{#each channels}}
    <li class="{{#if inChannel _id}}active{{/if}}">
      <a href="/channels/{{_id}}">
        <i class="fa fa-slack"></i> <span>{{name}}</span>
        {{#if countUnreadChannel _id}}
          <span class="pull-right-container">
            <span class="label label-danger pull-right">{{countUnreadChannel _id}}</span>
          </span>
        {{/if}}
      </a>
    </li>
  {{/each}}
</template>
